import request from '@/utils/request'

const system = {
  getUserMenuAPI: function (employeeCode, positionCode) {
    return request({
      url: '/sys/menu/employee/' + employeeCode,
      method: 'post',
      data: {positionCode}
    })
  },
  getMenuListAPI: function (params) {
    return request({
      url: '/sys/menu/list',
      method: 'post',
      data: params
    })
  },
  getMenuListPageAPI: function (params) {
    return request({
      url: '/sys/menu/pageList',
      method: 'post',
      data: params
    })
  },
  updateMenuAPI: function (params) {
    return request({
      url: '/sys/menu/update/' + params.menuCode,
      method: 'put',
      data: params
    })
  },
  getDictListAPI: function (params) {
    return request({
      url: '/sys/dict/list',
      method: 'post',
      data: params
    })
  },
  addDictAPI: function (params) {
    return request({
      url: '/sys/dict/add',
      method: 'post',
      data: params
    })
  },
  updateDictAPI: function (params) {
    return request({
      url: '/sys/dict/update/' + params.bizCode,
      method: 'put',
      data: params
    })
  },
  deleteDictAPI: function (bizCode) {
    return request({
      url: '/sys/dict/delete/' + bizCode,
      method: 'delete',
      data: {}
    })
  },
  getDictListByBizTypeAPI: function (bizType) {
    return request({
      url: '/sys/dict/type/' + bizType,
      method: 'get'
    })
  },
  getDictALlByBizTypeAPI: function () {
    return request({
      url: '/sys/dict/all/type',
      method: 'get'
    })
  },
  getDictInfoByBizCodeAPI: function (bizCode) {
    return request({
      url: '/sys/dict/code/' + bizCode,
      method: 'get'
    })
  },
  getRegionProvinceInfoListAPI: function (params) {
    return request({
      url: '/sys/region/province/list',
      method: 'post',
      data: params
    })
  },
  getCompanyInfoListAPI: function (params) {
    return request({
      url: '/sys/company/list',
      method: 'post',
      data: params
    })
  },
  getCompanyInfoAPI: function (companyCode) {
    return request({
      url: '/sys/company/detail/' + companyCode,
      method: 'get'
    })
  },
  updateCompanyInfoAPI: function (params) {
    return request({
      url: '/sys/company/update/' + params.companyCode,
      method: 'put',
      data: params
    })
  },
  createAccountCompanyAPI: function (params) {
    return request({
      url: '/sys/company/create/account',
      method: 'post',
      data: params
    })
  },
  uploadFileAPI: function (params) {
    return request({
      url: '/file/upload/single',
      method: 'post',
      data: params,
      headers: {
        'Content-Type': 'multipart/form-data'
      }
    })
  }
}
export default system
